<?php

namespace app\index\controller;
use app\commons\model\MemberSale;
use think\exception\ValidateException;

class SaleUser
{
    /**
     * 活动用户参与列表
     */
    public function index(MemberSale $memberSale){
        $data = request()->param();
        if(!isset($data['id'])) throw new ValidateException('参数错误！');
        $list = $memberSale->where(['sale_id'=>$data['id']])->order('id desc')->with(['members'])->paginate(10,false,['query'=>request()->param()]);
        return jsonp($list);
    }
}